package com.nbsaas.boot.shop.data.entity;

import com.nbsaas.boot.code.annotation.*;
import com.nbsaas.boot.jpa.data.entity.LongEntity;
import lombok.Data;
import org.hibernate.annotations.Comment;

import javax.persistence.*;
import java.util.Date;

@Data
@FormAnnotation(title = "商家广告图")
@Entity
@Table(name = "bs_shop_banner")
public class ShopBanner extends LongEntity {

    @FormField(title = "商家", grid = true, col = 22, type = InputType.select,ignore = true,width = "200")
    @FieldName
    @FieldConvert
    @ManyToOne(fetch = FetchType.LAZY)
    private Shop shop;

    @SearchItem(label = "名称", name = "name")
    @FormField(title = "名称", grid = true, col = 22)
    @Column(length = 20)
    private String name;

    @FormField(title = "广告图",col = 22,type = InputType.image)
    @Column(length = 300)
    private String logo;

    @FormField(title = "banner地址", grid = true, col = 22)
    @Column(length = 20)
    private String url;

    @FormField(title = "添加入", grid = true, col = 22,ignore = true)
    @FieldConvert
    @ManyToOne(fetch = FetchType.LAZY)
    private ShopStaff staff;


    @FormField(title = "排序号", grid = true, col = 22,type = InputType.el_input_number,sort = true)
    @Comment("排序号")
    private Integer sortNum;


    @FormField(title = "添加时间", grid = true, width = "10000", ignore = true)
    @Comment("添加时间")
    private Date addDate;

    @Comment("最新修改时间")
    private Date lastDate;

}
